<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
abc.parser (abc4j API Documentation)
</TITLE>

<META NAME="keywords" CONTENT="abc.parser package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="abc.parser (abc4j API Documentation)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
abc4j API Specification</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../abc/notation/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../abc/ui/awt/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html?abc/parser/package-summary.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<H2>
Package abc.parser
</H2>
This package contains classes for parsing tunes in abc notation.
<P>
<B>See:</B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
<P>

<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Interface Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcFileParserListenerInterface.html" title="interface in abc.parser">AbcFileParserListenerInterface</A></B></TD>
<TD>The interface to be implemented when parsing abc files.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/TuneBookListenerInterface.html" title="interface in abc.parser">TuneBookListenerInterface</A></B></TD>
<TD>This is the interface that should be implemented by any object that wants
 to listens to changes occured in a tunebook.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/TuneParserListenerInterface.html" title="interface in abc.parser">TuneParserListenerInterface</A></B></TD>
<TD>Interface that should be implemented by any object that listens to tunes
 parsing.</TD>
</TR>
</TABLE>
&nbsp;

<P>

<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcFileParser.html" title="class in abc.parser">AbcFileParser</A></B></TD>
<TD>This class provides instances to parse files and streams using
 abc notation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcFileParserAdapter.html" title="class in abc.parser">AbcFileParserAdapter</A></B></TD>
<TD>A default implementation of a file parser listener that does nothing.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcHeadersParser.html" title="class in abc.parser">AbcHeadersParser</A></B></TD>
<TD>This class provides parser instances that reduce the parsing 
 scope to tunes headers (music is excluded).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcParserAbstract.html" title="class in abc.parser">AbcParserAbstract</A></B></TD>
<TD>Abstract class from which all abc notation parsers inherit.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcTokenType.html" title="class in abc.parser">AbcTokenType</A></B></TD>
<TD>This class defines all types of token that can be encountered while parsing
 a tune written using abc notation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcToolkit.html" title="class in abc.parser">AbcToolkit</A></B></TD>
<TD>A class that provides convenience methods to manipulate abc related 
 strings and their representation using objects from the <TT>abc.notation</TT>
 package.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AbcToolkit.DurationDescription.html" title="class in abc.parser">AbcToolkit.DurationDescription</A></B></TD>
<TD>&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/AsynchronousTuneParser.html" title="class in abc.parser">AsynchronousTuneParser</A></B></TD>
<TD>A parser that parses abc gammar into its own thread context.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/InvalidTokenEvent.html" title="class in abc.parser">InvalidTokenEvent</A></B></TD>
<TD>Event generated when an invalid token is encountered by a parser.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/PositionableMultiNote.html" title="class in abc.parser">PositionableMultiNote</A></B></TD>
<TD>A multinote that encapsulates the information needed to locate where the abc 
 information describing this multinote was positioned in the parsed stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/PositionableNote.html" title="class in abc.parser">PositionableNote</A></B></TD>
<TD>A note that encapsulates the information needed to locate where the abc 
 information describing this note was positioned in the parsed stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/TuneBook.html" title="class in abc.parser">TuneBook</A></B></TD>
<TD>This class provides an object representation of a tunebook.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/TuneChangeEvent.html" title="class in abc.parser">TuneChangeEvent</A></B></TD>
<TD>Event used when a state changed occured on a tune.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/TuneParser.html" title="class in abc.parser">TuneParser</A></B></TD>
<TD>A convenient class to ease the parsing of ONE tune.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../abc/parser/TuneParserAdapter.html" title="class in abc.parser">TuneParserAdapter</A></B></TD>
<TD>An empty implementation of a tune parser listener that does nothing.</TD>
</TR>
</TABLE>
&nbsp;

<P>
<A NAME="package_description"><!-- --></A><H2>
Package abc.parser Description
</H2>

<P>
This package contains classes for parsing tunes in abc notation. It needs both <TT>scanner</TT> and 
<TT>abc.notation</TT> packages to work.
The purpose of classes from this package is to extract from the abc notation all the necessary information needed 
to represent the music with objects belonging to the <TT>abc.notation</TT>.<BR/>
<BR/>
abc4j propose several classes to instantiate abc parsers :
<UL>
        <LI><A HREF="../../abc/parser/AbcFileParser.html" title="class in abc.parser"><CODE>AbcFileParser</CODE></A> :  This class parses the abc stream and 
                provides you <A HREF="../../abc/notation/Tune.html" title="class in abc.notation"><CODE>Tune</CODE></A> instances with header information 
                (such as title, key etc...) and music part. 
        </LI>
        <LI><A HREF="../../abc/parser/AbcHeadersParser.html" title="class in abc.parser"><CODE>AbcHeadersParser</CODE></A> : This class restricts the 
                parsing to abc headers. This enables a faster parsing compared to the one 
                done using <TT>AbcFileParser</TT>.
        </LI>
        <LI><A HREF="../../abc/parser/TuneParser.html" title="class in abc.parser"><CODE>TuneParser</CODE></A> : This class is usefull when you 
                want to parse only one tune : you get the <A HREF="../../abc/notation/Tune.html" title="class in abc.notation"><CODE>Tune</CODE></A> result in a 
                synchronous manner without any listener mechanism. Quite convenient in some cases...
        </LI>
</UL>
Beside those standard ways to use parser, another class provides a more high level abstraction :
<UL>
        <LI><A HREF="../../abc/parser/TuneBook.html" title="class in abc.parser"><CODE>TuneBook</CODE></A> :  This class abstract an abc file as an 
                object and encpasulates the parsing phasis in its implementation (hidden
                from client perspective). <U>For a first use of the abc4j library, this 
                class is the best starting point.</U>
        </LI>
</UL>    
<HR/>
Some specific points should be pointed out during the translation from abc music notation to "standard"
music notation :
<OL>
<LI><B>Several different ways to express music using abc can lead to the same music.</B><BR/>
For instance, the two following tunes :
<PRE>
X:1
T:dots example
L:1/8
K:D
d3d

X:2
T:dots example
L:1/4
K:D
d&gt;d
</PRE>
describe the same melody : a dotted quarter note followed by eighth note. The consequence of this is that their 
representation in <TT>Note</TT> objects will be the same : the first note is a <TT>Note</TT> instance 
whose strict duration is <TT>Note.QUARTER</TT> and its <TT>countDots()</TT> will return 1.<BR/>
The second note is a <TT>Note.EIGHTH</TT> without any dot.<BR/><BR/>
</LI>
<LI><B>Some abc note lengths may be impossible to translate into standard music notation.</B><BR/>
For instance, let's consider the following tune :
<PRE>
X:1
T:impossible duration
L:1/8
K:D
d5
</PRE>
In such tune, the first note has a duration equals to 5 x eighth note. Such duration cannot be expressed
in standard music notation with one single note : a quarter note is 4 times a eighth note, and a dotted
quarter is 6 times a eighth note.<BR/>
For now, the resulting note will be an instance of the <TT>Note</TT> class but with an "exotic" duration.
One possible alternative would be to decompose this duration into several notes, but for now, the 
translation sticks to the approach "one abc note -&gt; one <TT>Note</TT> instance".
</LI>
</OL>
<P>

<P>
<DL>
</DL>
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
abc4j API Specification</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../abc/notation/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../abc/ui/awt/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html?abc/parser/package-summary.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<a href=mailto:lionel.gueganton@libertysurf.fr>Submit a bug or feature<a/>
</BODY>
</HTML>
